import { postForm, get, put } from '@/utils/request'

// 获取列表
export function getRecords(listQuery) {
  return get('/article/list/page', listQuery)
}

export function add(optData) {
  return postForm('/article', optData)
}

export function publishAriticle(optData) {
  return postForm('/article/publish/review/token', optData)
}

// 发布文章
export function edit(optData) {
  return put('/article', optData)
}

export function del(ids) {
  return postForm('/article/del/batch', { pkIds: JSON.stringify(ids) })
}

export function getArticleById(pkId) {
  return get('/article', { pkId: pkId })
}

export default { add, edit, del }
